import React, { PropsWithChildren } from 'react';
import { App as AntdApp } from "antd";
import { ProBrowserCheck } from "../pro-browserCheck";
import { ProBox } from '../pro-box';

export interface ProAppWrapperProps {
  loading?: boolean;
  allowBrowser?: any;
}

export const ProAppWrapper: React.FC<PropsWithChildren<ProAppWrapperProps>> = ({ loading = false, allowBrowser, children }) => {

  return <AntdApp>
    <ProBrowserCheck allowBrowser={allowBrowser}>
      <ProBox loading={loading}>
        {children}
      </ProBox>
    </ProBrowserCheck>
  </AntdApp>
}


export default ProAppWrapper;

